package org.jeecg.modules.bid.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@TableName("proc_bid")
@ApiModel(value = "Bid对象", description = "投标管理")
@Table(name = "proc_bid")
public class Bid implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;

    @ApiModelProperty(value = "采购方案ID")
    @NotBlank(message = "采购方案ID不能为空")
    @Column(name = "purchase_id")
    private String purchaseId;

    @ApiModelProperty(value = "项目名称")
    @Column(name = "project_name")
    private String projectName;

    @ApiModelProperty(value = "抽签ID")
    @NotBlank(message = "抽签ID不能为空")
    @Column(name = "lottery_Id")
    private String lotteryId;

    @ApiModelProperty(value = "预算金额")
    @Column(name = "budget_amount")
    private BigDecimal budgetAmount;

    @ApiModelProperty(value = "中标时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "winning_time")
    private Date winningTime;


    @ApiModelProperty(value = "所属类目")
    @Dict(dicCode = "engineering_category")
    @NotBlank(message = "所属类目不能为空")
    @Column(name = "category")
    private String category;

    @ApiModelProperty(value = "方案类型")
    @Column(name = "scheme_type")
    private String schemeType = "最低价中标";

    @ApiModelProperty(value = "供应商ID")
    @NotBlank(message = "供应商ID不能为空")
    @Column(name = "supplier_id")
    private String supplierId;

    @ApiModelProperty(value = "公司名称")
    @Column(name = "company_name")
    private String companyName;

    @ApiModelProperty(value = "投标价格")
    @Column(name = "bid_price")
    private BigDecimal bidPrice;

//    @ApiModelProperty(value = "投标文件")
//    @Column(name = "bid_document")
//    private String bidDocument;

    @ApiModelProperty(value = "投标时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "bid_time")
    private Date bidTime;

    @ApiModelProperty(value = "投标截止时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "bidding_end_time")
    private Date biddingEndTime;

    @ApiModelProperty(value = "开标时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "opening_time")
    private Date openingTime;

    @ApiModelProperty(value = "联系人")
    @Column(name = "contact_person")
    private String contactPerson;

    @ApiModelProperty(value = "联系电话")
    @Column(name = "contact_phone")
    private String contactPhone;

//    @ApiModelProperty(value = "投标IP地址")
//    @Column(name = "bid_ip")
//    private String bidIp;



    @ApiModelProperty(value = "解密时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "decrypt_time")
    private Date decryptTime;

    @ApiModelProperty(value = "投标说明")
    @Column(name = "bid_description")
    private String bidDescription;

    @ApiModelProperty(value = "投标状态:0-未报名，1-已报名，未报价，2-已报名，已报价，3-放弃报名，4-完成项目")
    @Dict(dicCode = "bid_status")
    @Column(name = "bid_status")
    private String bidStatus = "0";

    @ApiModelProperty(value = "是否中标：0-否，1-是")
    @Column(name = "is_winning")
    private Integer isWinning = 0;

    @ApiModelProperty(value = "解密状态:0-待解码,1-已解码'")
    @Dict(dicCode = "decrypt_status")
    @Column(name = "decrypt_status")
    private String decryptStatus = "0";

    @ApiModelProperty(value = "创建人")
    @Column(name = "create_by")
    private String createBy;

    @ApiModelProperty(value = "创建日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @Column(name = "create_time")
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @Column(name = "update_by")
    private String updateBy;

    @ApiModelProperty(value = "更新日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(name = "update_time")
    private Date updateTime;
}
